{ INFORMATICS.MCCME.RU
  Problem statement: http://informatics.mccme.ru/moodle/mod/statements/view3.php?chapterid=3077
  Verdict: Accepted
}
uses SysUtils, Math;
 
var
	n,ans,prev,cur:int64;
 
begin
reset(input,'input.txt');
rewrite(output,'output.txt');
read(n);
prev:=n;
ans:=1;
cur:=1;
while n<>0 do begin
	read(n);
	if n=prev then inc(cur) else begin
		ans:=max(ans,cur);
		cur:=1;
	end;
	prev:=n;	
end;
write(ans);
end.